# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1CertificateProvisioningProcess do
  @moduledoc """
  A certificate provisioning process.

  ## Attributes

  *   `chromeOsDevice` (*type:* `GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1ChromeOsDevice.t`, *default:* `nil`) - Output only. The client certificate is being provisioned for a ChromeOS device. This contains information about the device.
  *   `chromeOsUserSession` (*type:* `GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1ChromeOsUserSession.t`, *default:* `nil`) - Output only. The client certificate is being provisioned for a ChromeOS user. This contains information about the current user session.
  *   `failureMessage` (*type:* `String.t`, *default:* `nil`) - Output only. A message describing why this `CertificateProvisioningProcess` has failed. Presence of this field indicates that the `CertificateProvisioningProcess` has failed.
  *   `genericCaConnection` (*type:* `GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1GenericCaConnection.t`, *default:* `nil`) - Output only. The CA connection is a generic CA connection.
  *   `genericProfile` (*type:* `GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1GenericProfile.t`, *default:* `nil`) - Output only. The profile is a generic certificate provisioning profile.
  *   `issuedCertificate` (*type:* `String.t`, *default:* `nil`) - Output only. The issued certificate for this `CertificateProvisioningProcess` in PEM format.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. Resource name of the `CertificateProvisioningProcess`. The name pattern is given as `customers/{customer}/certificateProvisioningProcesses/{certificate_provisioning_process}` with `{customer}` being the obfuscated customer id and `{certificate_provisioning_process}` being the certificate provisioning process id.
  *   `provisioningProfileId` (*type:* `String.t`, *default:* `nil`) - Output only. The ID of the certificate provisioning profile.
  *   `signData` (*type:* `String.t`, *default:* `nil`) - Output only. The data that the client was asked to sign. This field is only present after the `SignData` operation has been initiated.
  *   `signature` (*type:* `String.t`, *default:* `nil`) - Output only. The signature of `signature_algorithm`, generated using the client's private key using `signature_algorithm`. This field is only present after the `SignData` operation has finished.
  *   `signatureAlgorithm` (*type:* `String.t`, *default:* `nil`) - Output only. The signature algorithm that the adapter expects the client and backend components to use when processing `sign_data`. This field is only present after the `SignData` operation has been initiated.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Server-generated timestamp of when the certificate provisioning process has been created.
  *   `subjectPublicKeyInfo` (*type:* `String.t`, *default:* `nil`) - Output only. The public key for which a certificate should be provisioned. Represented as a DER-encoded X.509 SubjectPublicKeyInfo.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :chromeOsDevice =>
            GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1ChromeOsDevice.t()
            | nil,
          :chromeOsUserSession =>
            GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1ChromeOsUserSession.t()
            | nil,
          :failureMessage => String.t() | nil,
          :genericCaConnection =>
            GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1GenericCaConnection.t()
            | nil,
          :genericProfile =>
            GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1GenericProfile.t()
            | nil,
          :issuedCertificate => String.t() | nil,
          :name => String.t() | nil,
          :provisioningProfileId => String.t() | nil,
          :signData => String.t() | nil,
          :signature => String.t() | nil,
          :signatureAlgorithm => String.t() | nil,
          :startTime => DateTime.t() | nil,
          :subjectPublicKeyInfo => String.t() | nil
        }

  field(:chromeOsDevice,
    as: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1ChromeOsDevice
  )

  field(:chromeOsUserSession,
    as: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1ChromeOsUserSession
  )

  field(:failureMessage)

  field(:genericCaConnection,
    as: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1GenericCaConnection
  )

  field(:genericProfile,
    as: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1GenericProfile
  )

  field(:issuedCertificate)
  field(:name)
  field(:provisioningProfileId)
  field(:signData)
  field(:signature)
  field(:signatureAlgorithm)
  field(:startTime, as: DateTime)
  field(:subjectPublicKeyInfo)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1CertificateProvisioningProcess do
  def decode(value, options) do
    GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1CertificateProvisioningProcess.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementVersionsV1CertificateProvisioningProcess do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
